package com.tool_stdy.IO.StreamTest;

import java.io.*;

/**
 * 字节流转为字符流
 * <p/>
 * Created by yan_li on 2017/1/10.
 */
public class StreamConver {

    public static void main(String[] args) throws Exception {
        File f = new File("F:/test/hah/789.txt");
        Reader read = new InputStreamReader(new FileInputStream(f),"utf-8");
        BufferedReader br = new BufferedReader(read);

        BufferedWriter write = new BufferedWriter(new FileWriter(new File("F:/test/hah/7891.txt")));
        String value=null;
        while(null!=(value=br.readLine())){
            System.out.println(value);
            write.write(value);
            write.newLine();
        }
        write.flush();
        write.close();

    }

}
